<html>

<head>
<meta name=标题 content="">
<meta name=关键词 content="">
<meta http-equiv=Content-Type content="text/html; charset=utf-8">
<meta name=Generator content="Microsoft Word 15 (filtered)">
<style>
<!--
 /* Font Definitions */
@font-face
	{font-family:"Courier New";
	panose-1:2 7 3 9 2 2 5 2 4 4;}
@font-face
	{font-family:Times;
	panose-1:0 0 5 0 0 0 0 2 0 0;}
@font-face
	{font-family:Wingdings;
	panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
	{font-family:"Cambria Math";
	panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
	{font-family:DengXian;
	panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
	{font-family:"\@DengXian";}
@font-face
	{font-family:"Microsoft YaHei";
	panose-1:2 11 5 3 2 2 4 2 2 4;}
@font-face
	{font-family:Menlo;
	panose-1:2 11 6 9 3 8 4 2 2 4;}
@font-face
	{font-family:"\@Microsoft YaHei";}
 /* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0cm;
	margin-bottom:.0001pt;
	text-align:justify;
	text-justify:inter-ideograph;
	font-size:12.0pt;
	font-family:DengXian;}
code
	{font-family:Courier;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
	{margin:0cm;
	margin-bottom:.0001pt;
	text-align:justify;
	text-justify:inter-ideograph;
	text-indent:21.0pt;
	font-size:12.0pt;
	font-family:DengXian;}
p.a, li.a, div.a
	{margin:0cm;
	margin-bottom:.0001pt;
	text-align:justify;
	text-justify:inter-ideograph;
	line-height:200%;
	font-size:12.0pt;
	font-family:"Microsoft YaHei";}
.MsoChpDefault
	{font-family:DengXian;}
 /* Page Definitions */
@page WordSection1
	{size:595.0pt 842.0pt;
	margin:72.0pt 90.0pt 72.0pt 90.0pt;
	layout-grid:15.6pt;}
div.WordSection1
	{page:WordSection1;}
 /* List Definitions */
ol
	{margin-bottom:0cm;}
ul
	{margin-bottom:0cm;}
-->
</style>

</head>

<body lang=ZH-CN style='text-justify-trim:punctuation'>

<div class=WordSection1 style='layout-grid:15.6pt'>

<p class=MsoNormal style='line-height:200%'><b><span lang=EN-US
style='font-size:14.0pt;line-height:200%;font-family:"Microsoft YaHei"'>sudo</span></b></p>

<p class=MsoNormal align=left style='margin-bottom:12.0pt;text-align:left;
text-indent:21.0pt;line-height:200%;text-autospace:none'><span lang=EN-US
style='font-family:"Microsoft YaHei";color:black;vertical-align:sub'>sudo</span><span
style='font-family:"Microsoft YaHei";color:black;vertical-align:sub'>允许用户以超级用户或安全策略指定的另一个用户的身份执行命令。<span
lang=EN-US>Sudo</span>支持安全策略插件和输入<span lang=EN-US>/</span>输出日志的插件。第三方可以开发和分发自己的策略和<span
lang=EN-US>I/O</span>日志插件，以便与<span lang=EN-US>sudo</span>前端无缝地工作。默认的安全策略是<span
lang=EN-US>sudoers</span>，它是通过文件<span lang=EN-US>/etc/sudoers</span>或通过<span
lang=EN-US>LDAP</span>配置的。</span></p>

<p class=MsoNormal align=left style='margin-bottom:12.0pt;text-align:left;
text-indent:21.0pt;line-height:200%;text-autospace:none'><span
style='font-family:"Microsoft YaHei";color:black;vertical-align:sub'>安全策略确定用户在需要什么权利的时候需要运行<span
lang=EN-US>sudo</span>。该策略可能要求用户使用密码或其他身份验证机制进行身份验证。如果需要身份验证，如果用户的密码未在可配置的时限内输入，<span
lang=EN-US>sudo</span>将退出。此限制是特定于策略的；<span lang=EN-US>sudoers</span>安全策略的默认密码提示超时为<span
lang=EN-US>5</span>分钟。</span></p>

<p class=MsoNormal align=left style='margin-bottom:12.0pt;text-align:left;
text-indent:21.0pt;line-height:200%;text-autospace:none'><span
style='font-family:"Microsoft YaHei";color:black;vertical-align:sub'>安全策略可能支持凭据缓存，允许用户在不需要身份验证的情况下再次运行<span
lang=EN-US>sudo</span>。<span lang=EN-US>sudoers</span>策略将凭据缓存<span lang=EN-US>5</span>分钟，除非在<span
lang=EN-US>sudoers(5)</span>中重写。通过使用“<span lang=EN-US>-v</span>”选项运行<span
lang=EN-US>sudo</span>，用户可以在不运行命令的情况下更新缓存的凭据。</span></p>

<p class=MsoNormal align=left style='margin-bottom:12.0pt;text-align:left;
text-indent:21.0pt;line-height:200%;text-autospace:none'><span
style='font-family:"Microsoft YaHei";color:black;vertical-align:sub'>安全策略可能记录使用<span
lang=EN-US>sudo</span>的成功和失败情况。如果配置了<span lang=EN-US>I/O</span>插件，运行中的命令的输入和输出也可能被记录下来。</span></p>

<p class=MsoNormal align=left style='margin-bottom:12.0pt;text-align:left;
text-indent:21.0pt;line-height:200%;text-autospace:none'><span
style='font-family:"Microsoft YaHei";color:black;vertical-align:sub'>此命令的适用范围：<span
lang=EN-US>RedHat</span>、<span lang=EN-US>RHEL</span>、<span lang=EN-US>Ubuntu</span>、<span
lang=EN-US>CentOS</span>、<span lang=EN-US>SUSE</span>、<span lang=EN-US>openSUSE</span>、<span
lang=EN-US>Fedora</span>。</span></p>

<p class=MsoNormal style='line-height:200%'><b><span lang=EN-US
style='font-family:"Microsoft YaHei"'>1</span></b><b><span style='font-family:
"Microsoft YaHei"'>、语法</span></b></p>

<p class=MsoNormal style='text-indent:21.0pt;line-height:200%'><b><span
lang=EN-US style='font-family:"Microsoft YaHei"'>sudo  -h | -K | -k | -V</span></b></p>

<p class=MsoNormal style='text-indent:21.0pt;line-height:200%'><b><span
lang=EN-US style='font-family:"Microsoft YaHei"'>sudo  -v  [-AknS]  [-g group
name | #gid]  [-p prompt]  [-u user name | #uid]</span></b></p>

<p class=MsoNormal style='text-indent:21.0pt;line-height:200%'><b><span
lang=EN-US style='font-family:"Microsoft YaHei"'>sudo  -l[l] [-AknS]  [-g group
name | #gid]  [-p prompt]  [-U user name]  [-u user name | #uid]  [command]</span></b></p>

<p class=MsoNormal style='text-indent:21.0pt;line-height:200%'><b><span
lang=EN-US style='font-family:"Microsoft YaHei"'>sudo  [-AbEHnPS]  [-C fd]  [-g
group name | #gid]  [-p prompt]  [-r role]  [-t type]  [-u user name | #uid]  [VAR=value]
 -i |  -s [command]</span></b></p>

<p class=MsoNormal style='text-indent:21.0pt;line-height:200%'><b><span
lang=EN-US style='font-family:"Microsoft YaHei"'>sudoedit  [-AnS]  [-C fd]  [-g
group name | #gid]  [-p prompt]  [-u user name | #uid]  file  ...</span></b></p>

<p class=MsoNormal style='line-height:200%'><b><span lang=EN-US
style='font-family:"Microsoft YaHei"'>&nbsp;</span></b></p>

<p class=MsoNormal style='line-height:200%'><b><span lang=EN-US
style='font-family:"Microsoft YaHei"'>2</span></b><b><span style='font-family:
"Microsoft YaHei"'>、选项列表</span></b></p>

<table class=MsoTableGrid border=1 cellspacing=0 cellpadding=0 width="95%"
 style='width:95.0%;margin-left:24.1pt;border-collapse:collapse;border:none'>
 <tr>
  <td width="28%" valign=top style='width:28.58%;border:solid windowtext 1.0pt;
  background:#E7E6E6;padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><span style='font-family:"Microsoft YaHei"'>选项</span></p>
  </td>
  <td width="71%" valign=top style='width:71.42%;border:solid windowtext 1.0pt;
  border-left:none;background:#E7E6E6;padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><span style='font-family:"Microsoft YaHei"'>说明</span></p>
  </td>
 </tr>
 <tr>
  <td width="28%" valign=top style='width:28.58%;border:solid windowtext 1.0pt;
  border-top:none;padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><span lang=EN-US
  style='font-family:"Microsoft YaHei"'>-h</span></p>
  </td>
  <td width="71%" valign=top style='width:71.42%;border-top:none;border-left:
  none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
  padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><span style='font-family:"Microsoft YaHei"'>帮助信息</span></p>
  </td>
 </tr>
 <tr>
  <td width="28%" valign=top style='width:28.58%;border:solid windowtext 1.0pt;
  border-top:none;padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><span lang=EN-US
  style='font-family:"Microsoft YaHei"'>-V</span></p>
  </td>
  <td width="71%" valign=top style='width:71.42%;border-top:none;border-left:
  none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
  padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><span style='font-family:"Microsoft YaHei"'>显示命令版本信息</span></p>
  </td>
 </tr>
 <tr>
  <td width="28%" valign=top style='width:28.58%;border:solid windowtext 1.0pt;
  border-top:none;padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><span lang=EN-US
  style='font-family:"Microsoft YaHei"'>-A</span></p>
  </td>
  <td width="71%" valign=top style='width:71.42%;border-top:none;border-left:
  none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
  padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><span style='font-family:"Microsoft YaHei"'>通常，如果<span
  lang=EN-US>sudo</span>需要密码，它就会从用户终端读取密码。如果指定了<span lang=EN-US>-A(Askpass)</span>选项，则执行一个<span
  lang=EN-US>(</span>可能是<span lang=EN-US>Graphi cal)</span>帮助程序来读取用户密码并将密码输出到标准输出。如果设置了<span
  lang=EN-US>SUDO_ASKPASS</span>环境变量，则指定助手程序的路径。否则，如果“<span lang=EN-US>/etc/sudo.conf</span>”包含了<span
  lang=EN-US>askpass</span>程序的路径，将使用该值。例如：</span></p>
  <p class=MsoNormal style='line-height:200%'><span lang=EN-US
  style='font-family:"Microsoft YaHei"'># Path to askpass helper program</span></p>
  <p class=MsoNormal style='line-height:200%'><span lang=EN-US
  style='font-family:"Microsoft YaHei"'>Path askpass /usr/X11R6/bin/ssh-askpass</span></p>
  </td>
 </tr>
 <tr>
  <td width="28%" valign=top style='width:28.58%;border:solid windowtext 1.0pt;
  border-top:none;padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><span lang=EN-US
  style='font-family:"Microsoft YaHei"'>-b</span></p>
  </td>
  <td width="71%" valign=top style='width:71.42%;border-top:none;border-left:
  none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
  padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><span style='font-family:"Microsoft YaHei"'>在后台运行命令。请注意，如果使用<span
  lang=EN-US>-b</span>选项，则不能使用<span lang=EN-US>shell</span>作业控件操作进程。大多数交互命令在后台模式下都无法正常工作。</span></p>
  </td>
 </tr>
 <tr>
  <td width="28%" valign=top style='width:28.58%;border:solid windowtext 1.0pt;
  border-top:none;padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><span lang=EN-US
  style='font-family:"Microsoft YaHei"'>-C fd</span></p>
  </td>
  <td width="71%" valign=top style='width:71.42%;border-top:none;border-left:
  none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
  padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><span style='font-family:"Microsoft YaHei"'>通常，<span
  lang=EN-US>sudo</span>将关闭除标准输入、标准输出和标准错误之外的所有打开的文件描述符。“<span lang=EN-US>-C</span>”选项允许用户在标准错误<span
  lang=EN-US>(</span>文件描述符<span lang=EN-US>3)</span>之上指定起点。不允许值小于<span
  lang=EN-US>3</span>。安全策略可能限制用户使用“<span lang=EN-US>-C</span>”选项的能力。<span
  lang=EN-US>sudoers</span>策略仅允许用户只有在开启“<span lang=EN-US>closefrom_override</span>”之后，才可以使用“<span
  lang=EN-US>-C</span>”选项</span></p>
  </td>
 </tr>
 <tr style='height:21.15pt'>
  <td width="28%" valign=top style='width:28.58%;border:solid windowtext 1.0pt;
  border-top:none;padding:0cm 5.4pt 0cm 5.4pt;height:21.15pt'>
  <p class=MsoNormal style='line-height:200%'><span lang=EN-US
  style='font-family:"Microsoft YaHei"'>-E</span></p>
  </td>
  <td width="71%" valign=top style='width:71.42%;border-top:none;border-left:
  none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
  padding:0cm 5.4pt 0cm 5.4pt;height:21.15pt'>
  <p class=MsoNormal><span style='font-family:"Microsoft YaHei";color:black'>运行时保留用户环境。“<span
  lang=EN-US>-E</span>”选项向安全策略指示用户希望保存他们现有的环境变量。如果指定了“<span lang=EN-US>-E</span>”选项，且用户没有保留环境的权限，则安全策略可能返回错误</span></p>
  </td>
 </tr>
 <tr>
  <td width="28%" valign=top style='width:28.58%;border:solid windowtext 1.0pt;
  border-top:none;padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><span lang=EN-US
  style='font-family:"Microsoft YaHei"'>-e</span></p>
  </td>
  <td width="71%" valign=top style='width:71.42%;border-top:none;border-left:
  none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
  padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><span style='font-family:"Microsoft YaHei"'>编辑命令文件，而不是执行命令。当查询安全策略的时候，使用字符串“<span
  lang=EN-US>sudoedit</span>”代替命令。如果用户通过策略认证，有<span lang=EN-US>3</span>个步骤需要做：<span
  lang=EN-US>1</span>）产生一个临时的副本；<span lang=EN-US>2</span>）运行策略指定的编辑器来编辑临时文件。<span
  lang=EN-US>sudoers</span>策略依次使用环境变量<span lang=EN-US>SUDO_EDITOR,</span>、<span
  lang=EN-US>VISUAL </span>、<span lang=EN-US>EDITOR</span>。如果没有设置这三个环境变量，则使用编辑器<span
  lang=EN-US>sudoers(5)</span>选项中列出的第一个程序；<span lang=EN-US>3</span>）如果修改了临时文件，则将临时文件复制回原来的位置，并移除临时版本。</span></p>
  <p class=MsoNormal style='line-height:200%'><span style='font-family:"Microsoft YaHei"'>如果指定的文件不存在，它将被创建。注意，与<span
  lang=EN-US>sudo</span>运行的大多数命令不同，编辑器是在调用用户的环境中运行的。如果由于某些原因，<span lang=EN-US>sudo</span>无法用指定的编辑器更新文件，则用户将收到警告，编辑后的副本将保留在临时文件中。</span></p>
  </td>
 </tr>
 <tr>
  <td width="28%" valign=top style='width:28.58%;border:solid windowtext 1.0pt;
  border-top:none;padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><span lang=EN-US
  style='font-family:"Microsoft YaHei"'>-g group </span></p>
  </td>
  <td width="71%" valign=top style='width:71.42%;border-top:none;border-left:
  none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
  padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><span style='font-family:"Microsoft YaHei"'>由指定的用户组来执行命令。使用<span
  lang=EN-US>#gid</span>，而不是组名。注意，<span lang=EN-US>shell</span>要求使用反斜杠<span
  lang=EN-US>(‘\’)</span>转义<span lang=EN-US>‘#’</span></span></p>
  </td>
 </tr>
 <tr>
  <td width="28%" valign=top style='width:28.58%;border:solid windowtext 1.0pt;
  border-top:none;padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><span lang=EN-US
  style='font-family:"Microsoft YaHei"'>-H</span></p>
  </td>
  <td width="71%" valign=top style='width:71.42%;border-top:none;border-left:
  none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
  padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><span lang=EN-US
  style='font-family:"Microsoft YaHei"'>-H(Home)</span><span style='font-family:
  "Microsoft YaHei"'>选项要求安全策略将“<span lang=EN-US>HOME</span>”环境变量设置为由密码数据库指定的目标用户的家目录。根据策略，这个选项很可能是默认的。</span></p>
  </td>
 </tr>
 <tr>
  <td width="28%" valign=top style='width:28.58%;border:solid windowtext 1.0pt;
  border-top:none;padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><span lang=EN-US
  style='font-family:"Microsoft YaHei"'>-i [command]</span></p>
  </td>
  <td width="71%" valign=top style='width:71.42%;border-top:none;border-left:
  none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
  padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><span style='font-family:"Microsoft YaHei"'>模拟初始登录。“<span
  lang=EN-US>-i“</span>选项将目标用户的密码数据库条目指定的<span lang=EN-US>shell</span>作为登录<span
  lang=EN-US>shell</span>运行。这意味着<span lang=EN-US>shell</span>将读取特定于登录的资源文件，如<span
  lang=EN-US>“.profile”</span>或<span lang=EN-US>“.login”</span>。如果指定了命令，则通过<span
  lang=EN-US>shell</span>的<span lang=EN-US>-c</span>选项将其传递给<span lang=EN-US>shell</span>执行。如果未指定命令，则执行交互式<span
  lang=EN-US>shell</span>。<span lang=EN-US>sudo</span>试图在运行<span lang=EN-US>shell</span>之前更改到该用户的家目录。安全策略应将环境初始化为最小变量集，类似于用户登录时存在的变量集。</span></p>
  </td>
 </tr>
 <tr>
  <td width="28%" valign=top style='width:28.58%;border:solid windowtext 1.0pt;
  border-top:none;padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><span lang=EN-US
  style='font-family:"Microsoft YaHei"'>-K</span></p>
  </td>
  <td width="71%" valign=top style='width:71.42%;border-top:none;border-left:
  none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
  padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><span style='font-family:"Microsoft YaHei"'>删除用户缓存的凭据，不能与命令或其他选项一起使用。此选项不需要密码。并非所有安全策略都支持凭据缓存。</span></p>
  </td>
 </tr>
 <tr>
  <td width="28%" valign=top style='width:28.58%;border:solid windowtext 1.0pt;
  border-top:none;padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><span lang=EN-US
  style='font-family:"Microsoft YaHei"'>-k [command]</span></p>
  </td>
  <td width="71%" valign=top style='width:71.42%;border-top:none;border-left:
  none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
  padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><span style='font-family:"Microsoft YaHei"'>单独使用时，<span
  lang=EN-US>sudo</span>选项可以使用户的缓存凭据无效。下一次运行<span lang=EN-US>sudo</span>时，将需要密码。此选项不需要密码，添加该选项是为了允许用户从<span
  lang=EN-US>.logout</span>文件中撤消<span lang=EN-US>sudo</span>权限。并非所有安全策略都支持凭据缓存。</span></p>
  <p class=MsoNormal style='line-height:200%'><span style='font-family:"Microsoft YaHei"'>当与可能需要密码的命令或选项一起使用时，“<span
  lang=EN-US>-k</span>”选项将导致<span lang=EN-US>sudo</span>忽略用户的缓存凭据。因此，<span
  lang=EN-US>sudo</span>将提示输入密码<span lang=EN-US>(</span>如果安全策略需要密码<span
  lang=EN-US>)</span>，并且不会更新用户缓存的凭据。</span></p>
  </td>
 </tr>
 <tr>
  <td width="28%" valign=top style='width:28.58%;border:solid windowtext 1.0pt;
  border-top:none;padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><span lang=EN-US
  style='font-family:"Microsoft YaHei"'>-l[l] [command]</span></p>
  </td>
  <td width="71%" valign=top style='width:71.42%;border-top:none;border-left:
  none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
  padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><span style='font-family:"Microsoft YaHei"'>列出用户能执行的命令。如果没有指定命令，则<span
  lang=EN-US>-l(List)</span>选项将列出当前主机上调用用户<span lang=EN-US>(</span>或<span
  lang=EN-US>-u</span>选项指定的用户<span lang=EN-US>)</span>所允许的命令。如果指定了命令并得到安全策略的允许，则会显示命令的完全路径以及任何命令行参数。如果指定了命令但不允许执行，<span
  lang=EN-US>sudo</span>将退出，状态值为<span lang=EN-US>1</span>。如果使用<span lang=EN-US>l</span>参数<span
  lang=EN-US>(</span>即<span lang=EN-US>-ll)</span>，则使用较长的列表格式。</span></p>
  </td>
 </tr>
 <tr>
  <td width="28%" valign=top style='width:28.58%;border:solid windowtext 1.0pt;
  border-top:none;padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><span lang=EN-US
  style='font-family:"Microsoft YaHei"'>-n</span></p>
  </td>
  <td width="71%" valign=top style='width:71.42%;border-top:none;border-left:
  none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
  padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><span style='font-family:"Microsoft YaHei"'>非交互式，将不提示用户。<span
  lang=EN-US>-n</span>选项防止<span lang=EN-US>sudo</span>提示用户输入密码。如果运行命令需要密码，<span
  lang=EN-US>sudo</span>将显示错误消息并退出。</span></p>
  </td>
 </tr>
 <tr>
  <td width="28%" valign=top style='width:28.58%;border:solid windowtext 1.0pt;
  border-top:none;padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><span lang=EN-US
  style='font-family:"Microsoft YaHei"'>-P</span></p>
  </td>
  <td width="71%" valign=top style='width:71.42%;border-top:none;border-left:
  none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
  padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><span style='font-family:"Microsoft YaHei"'>保存组向量。“<span
  lang=EN-US>-P“</span>选项使<span lang=EN-US>sudo</span>保持调用用户的组向量不变。默认情况下，<span
  lang=EN-US>sudoers</span>策略将组向量初始化为目标用户所在的组列表。然而，实际有效的组<span lang=EN-US>ID</span>仍然被设置为与目标用户匹配。</span></p>
  </td>
 </tr>
 <tr>
  <td width="28%" valign=top style='width:28.58%;border:solid windowtext 1.0pt;
  border-top:none;padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><span lang=EN-US
  style='font-family:"Microsoft YaHei"'>-p prompt</span></p>
  </td>
  <td width="71%" valign=top style='width:71.42%;border-top:none;border-left:
  none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
  padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><span style='font-family:"Microsoft YaHei"'>使用指定的密码提示语句：</span></p>
  <p class=MsoNormal style='line-height:200%'><span lang=EN-US
  style='font-family:"Microsoft YaHei"'>%H</span><span style='font-family:"Microsoft YaHei"'>，扩展为主机名，包括域名；</span></p>
  <p class=MsoNormal style='line-height:200%'><span lang=EN-US
  style='font-family:"Microsoft YaHei"'>%h</span><span style='font-family:"Microsoft YaHei"'>，扩展为主机名，不包括域名；</span></p>
  <p class=MsoNormal style='line-height:200%'><span lang=EN-US
  style='font-family:"Microsoft YaHei"'>%p</span><span style='font-family:"Microsoft YaHei"'>，扩展为请求其密码的用户的名称；</span></p>
  <p class=MsoNormal style='line-height:200%'><span lang=EN-US
  style='font-family:"Microsoft YaHei"'>%U</span><span style='font-family:"Microsoft YaHei"'>，扩展到运行命令的用户的登录名；</span></p>
  <p class=MsoNormal style='line-height:200%'><span lang=EN-US
  style='font-family:"Microsoft YaHei"'>%u</span><span style='font-family:"Microsoft YaHei"'>，扩展到调用用户的登录名；</span></p>
  <p class=MsoNormal style='line-height:200%'><span lang=EN-US
  style='font-family:"Microsoft YaHei"'>%%</span><span style='font-family:"Microsoft YaHei"'>，两个连续的<span
  lang=EN-US>‘%’</span>字符折叠成一个<span lang=EN-US>‘%’</span>字符；</span></p>
  </td>
 </tr>
 <tr>
  <td width="28%" valign=top style='width:28.58%;border:solid windowtext 1.0pt;
  border-top:none;padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><span lang=EN-US
  style='font-family:"Microsoft YaHei"'>-r role</span></p>
  </td>
  <td width="71%" valign=top style='width:71.42%;border-top:none;border-left:
  none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
  padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><span style='font-family:"Microsoft YaHei"'>“<span
  lang=EN-US>-r“</span>选项将导致新的安全上下文具有由<span lang=EN-US>role</span>指定的角色。</span></p>
  </td>
 </tr>
 <tr>
  <td width="28%" valign=top style='width:28.58%;border:solid windowtext 1.0pt;
  border-top:none;padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><span lang=EN-US
  style='font-family:"Microsoft YaHei"'>-S </span></p>
  </td>
  <td width="71%" valign=top style='width:71.42%;border-top:none;border-left:
  none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
  padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><span style='font-family:"Microsoft YaHei"'>从标准输入读取密码，而不是终端获取。密码后面必须跟着换行符</span></p>
  </td>
 </tr>
 <tr style='height:33.05pt'>
  <td width="28%" valign=top style='width:28.58%;border:solid windowtext 1.0pt;
  border-top:none;padding:0cm 5.4pt 0cm 5.4pt;height:33.05pt'>
  <p class=MsoNormal style='line-height:200%'><span lang=EN-US
  style='font-family:"Microsoft YaHei"'>-s [command]</span></p>
  </td>
  <td width="71%" valign=top style='width:71.42%;border-top:none;border-left:
  none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
  padding:0cm 5.4pt 0cm 5.4pt;height:33.05pt'>
  <p class=MsoNormal style='line-height:200%'><span style='font-family:"Microsoft YaHei"'>如果设置了<span
  lang=EN-US>shell</span>环境变量，则“<span lang=EN-US>-s“</span>选项运行由<span
  lang=EN-US>shell</span>环境变量指定的<span lang=EN-US>shell</span>，或者运行密码数据库中指定的<span
  lang=EN-US>shell</span>。如果指定了命令，则通过<span lang=EN-US>shell</span>的”<span
  lang=EN-US>-c</span>“选项将命令传递给<span lang=EN-US>shell</span>执行。如果没有指定命令，则执行交互式<span
  lang=EN-US>shell</span>。</span></p>
  </td>
 </tr>
 <tr style='height:33.05pt'>
  <td width="28%" valign=top style='width:28.58%;border:solid windowtext 1.0pt;
  border-top:none;padding:0cm 5.4pt 0cm 5.4pt;height:33.05pt'>
  <p class=MsoNormal style='line-height:200%'><span lang=EN-US
  style='font-family:"Microsoft YaHei"'>-t type</span></p>
  </td>
  <td width="71%" valign=top style='width:71.42%;border-top:none;border-left:
  none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
  padding:0cm 5.4pt 0cm 5.4pt;height:33.05pt'>
  <p class=MsoNormal style='line-height:200%'><span style='font-family:"Microsoft YaHei"'>“<span
  lang=EN-US>-t“</span>选项将导致新的安全上下文的类型，如果没有指定类型，则从指定的角色派生默认类型。</span></p>
  </td>
 </tr>
 <tr style='height:33.05pt'>
  <td width="28%" valign=top style='width:28.58%;border:solid windowtext 1.0pt;
  border-top:none;padding:0cm 5.4pt 0cm 5.4pt;height:33.05pt'>
  <p class=MsoNormal style='line-height:200%'><span lang=EN-US
  style='font-family:"Microsoft YaHei"'>-U user</span></p>
  </td>
  <td width="71%" valign=top style='width:71.42%;border-top:none;border-left:
  none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
  padding:0cm 5.4pt 0cm 5.4pt;height:33.05pt'>
  <p class=MsoNormal style='line-height:200%'><span style='font-family:"Microsoft YaHei"'>“<span
  lang=EN-US>-U</span>”选项与“<span lang=EN-US>-l</span>”选项一起使用，以列出指定用户的权限。安全策略可能限制列出其他用户的特权。<span
  lang=EN-US>sudoers</span>策略只允许<span lang=EN-US>root</span>或当前主机上具有完整特权的用户使用此选项。</span></p>
  </td>
 </tr>
 <tr>
  <td width="28%" valign=top style='width:28.58%;border:solid windowtext 1.0pt;
  border-top:none;padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><span lang=EN-US
  style='font-family:"Microsoft YaHei"'>-u user</span></p>
  </td>
  <td width="71%" valign=top style='width:71.42%;border-top:none;border-left:
  none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
  padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><span style='font-family:"Microsoft YaHei"'>以指定的用户身份执行指令。“<span
  lang=EN-US>-u</span>“选项使<span lang=EN-US>sudo</span>以<span lang=EN-US>root</span>以外的用户身份运行指定的命令。要指定<span
  lang=EN-US>#uid</span>而不是用户名。当以<span lang=EN-US>uid</span>的形式运行命令时，许多<span
  lang=EN-US>shell</span>要求用反斜杠<span lang=EN-US>‘\’</span>转义<span lang=EN-US>“#”</span>。安全策略可能会将<span
  lang=EN-US>UID</span>限制在密码数据库。<span lang=EN-US>sudoers</span>策略允许不存在于密码数据库中的<span
  lang=EN-US>UID</span>，只要没有设置<span lang=EN-US>targetpw</span>选项。其他安全策略可能不支持这一点。</span></p>
  </td>
 </tr>
 <tr>
  <td width="28%" valign=top style='width:28.58%;border:solid windowtext 1.0pt;
  border-top:none;padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><span lang=EN-US
  style='font-family:"Microsoft YaHei"'>-v</span></p>
  </td>
  <td width="71%" valign=top style='width:71.42%;border-top:none;border-left:
  none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
  padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><span style='font-family:"Microsoft YaHei"'>当给定<span
  lang=EN-US>-v(</span>验证<span lang=EN-US>)</span>选项时，<span lang=EN-US>sudo</span>将更新用户的缓存凭据，必要时对用户密码进行身份验证。对于<span
  lang=EN-US>sudoers</span>插件，这会将<span lang=EN-US>sudo</span>超时再延长<span
  lang=EN-US>5</span>分钟<span lang=EN-US>(</span>或安全策略设置的超时时间<span lang=EN-US>)</span>，但不会运行命令</span></p>
  </td>
 </tr>
 <tr>
  <td width="28%" valign=top style='width:28.58%;border:solid windowtext 1.0pt;
  border-top:none;padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><span lang=EN-US
  style='font-family:"Microsoft YaHei"'>--</span></p>
  </td>
  <td width="71%" valign=top style='width:71.42%;border-top:none;border-left:
  none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
  padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><span style='font-family:"Microsoft YaHei"'>这个选项提示，<span
  lang=EN-US>sudo</span>应该停止处理命令行参数</span></p>
  </td>
 </tr>
</table>

<p class=MsoNormal style='line-height:200%'><span lang=EN-US style='font-family:
"Microsoft YaHei"'>&nbsp;</span></p>

<p class=MsoNormal style='text-indent:21.0pt;line-height:200%'><span
style='font-family:"Microsoft YaHei"'>为命令设置的环境变量也可以<span lang=EN-US>var=value</span>的形式传递到命令行，例如<span
lang=EN-US>LD_Library_path=/usr/local/pkg/lib</span>。传递到命令行的变量受与正常环境变量相同的限制，但有一个重要的例外。如果在<span
lang=EN-US>sudoers</span>中设置<span lang=EN-US>setenv</span>选项，则要运行的命令具有<span
lang=EN-US>SETENV</span>标记集或匹配的命令。</span></p>

<p class=MsoNormal style='line-height:200%'><span lang=EN-US style='font-family:
"Microsoft YaHei"'>&nbsp;</span></p>

<p class=MsoNormal style='line-height:200%'><b><span lang=EN-US
style='font-family:"Microsoft YaHei"'>3</span></b><b><span style='font-family:
"Microsoft YaHei"'>、执行命令</span></b></p>

<p class=MsoNormal style='text-indent:21.0pt;line-height:200%'><span
style='font-family:"Microsoft YaHei"'>当<span lang=EN-US>sudo</span>执行命令时，安全策略指定命令的执行环境。通常，将实际有效的<span
lang=EN-US>uid</span>和<span lang=EN-US>gid</span>设置为与密码数据库中指定的目标用户相匹配，并根据组数据库初始化组向量<span
lang=EN-US>(</span>除非指定了<span lang=EN-US>-p</span>选项<span lang=EN-US>)</span>。安全策略可能会指定一些参数：真实有效用户<span
lang=EN-US>ID</span>、真实有效组<span lang=EN-US>ID</span>、补充组<span lang=EN-US>ID</span>、环境列表、当前工作目录、文件创建掩码、<span
lang=EN-US>SELinux</span>的角色和类型、调度级别。</span></p>

<p class=MsoNormal style='text-indent:21.0pt;line-height:200%'><span
lang=EN-US style='font-family:"Microsoft YaHei"'>1</span><span
style='font-family:"Microsoft YaHei"'>）进程模型</span></p>

<p class=MsoNormal style='line-height:200%'><span style='font-family:"Microsoft YaHei"'>当<span
lang=EN-US>sudo</span>运行一个命令时，它调用<span lang=EN-US>fork(2)</span>，设置上面描述的执行环境，并在子进程中调用<span
lang=EN-US>execve</span>系统调用。主<span lang=EN-US>sudo</span>进程等待命令完成，然后将命令的退出状态传递给安全策略的<span
lang=EN-US>close</span>方法并退出。如果配置了<span lang=EN-US>I/O</span>日志插件，则将一个新的伪终端<span
lang=EN-US>((“pty”)</span>被创建，第二个<span lang=EN-US>sudo</span>进程用于在用户现有的<span
lang=EN-US>pty</span>和正在运行的新<span lang=EN-US>pty</span>之间传递作业控制信号。这个额外的进程使挂起并恢复命令成为可能。如果没有它，命令将使用<span
lang=EN-US>POSIX</span>术语中的<span lang=EN-US>“</span>孤立进程组<span lang=EN-US>”</span>。也不会收到任何作业控制信号</span></p>

<p class=MsoNormal style='text-indent:21.0pt;line-height:200%'><span
lang=EN-US style='font-family:"Microsoft YaHei"'>2</span><span
style='font-family:"Microsoft YaHei"'>）信号处理</span></p>

<p class=MsoNormal style='text-indent:21.0pt;line-height:200%'><span
style='font-family:"Microsoft YaHei"'>因为命令是作为<span lang=EN-US>sudo</span>进程的子进程运行的，所以<span
lang=EN-US>sudo</span>会将接收到的信号中继到命令。除非该命令在新的<span lang=EN-US>pty</span>中运行，否则<span
lang=EN-US>SIGHUP</span>、<span lang=EN-US>SIGINT</span>和<span lang=EN-US>SIGQUIT</span>信号将不会被中继，除非它们是由用户进程而不是内核发送的。否则，该命令将在用户按下“<span
lang=EN-US>ctrl+c</span>”时接收到两次<span lang=EN-US>SIGINT.</span>信号。由于<span
lang=EN-US>SIGSTOP</span>和<span lang=EN-US>SIGKILL</span>不能被捕获，因此不会被中继到命令。作为一般规则，当您希望挂起<span
lang=EN-US>sudo</span>运行的命令时，应该使用<span lang=EN-US>SIGTSTP</span>而不是<span
lang=EN-US>SIGSTOP</span>。</span></p>

<p class=MsoNormal style='text-indent:21.0pt;line-height:200%'><span
style='font-family:"Microsoft YaHei"'>作为特例，<span lang=EN-US>sudo</span>将不会中继它正在运行的命令发送的信号。这可以防止命令意外地杀死自己。在某些系统上，<span
lang=EN-US>reboot(8)</span>命令在重新启动系统之前将<span lang=EN-US>SIGTERM</span>发送到所有非系统进程，而不是它自己。这防止<span
lang=EN-US>sudo</span>将接收到的<span lang=EN-US>SIGTERM</span>信号中继回<span
lang=EN-US>reboot(8)</span>，然后该信号可能会在系统实际启动之前退出，使其处于类似于单用户模式的半死状态。但是，请注意，此检查只适用于<span
lang=EN-US>sudo</span>运行的命令，而不适用于命令可能创建的任何其他进程。因此，通过<span lang=EN-US>sudo</span>运行调用重<span
lang=EN-US>reboot(8)</span>或<span lang=EN-US>shutdown(8)</span>的脚本可能导致系统处于这种未定义状态，除非使用<span
lang=EN-US>exec()</span>函数系列而不是<span lang=EN-US>system()</span>运行<span
lang=EN-US>reboot(8)</span>或<span lang=EN-US>shutdown(8)(</span>后者在命令和调用进程之间插入一个<span
lang=EN-US>shell)</span>。</span></p>

<p class=MsoNormal style='line-height:200%'><span lang=EN-US style='font-family:
"Microsoft YaHei"'>&nbsp;</span></p>

<p class=MsoNormal style='line-height:200%'><b><span lang=EN-US
style='font-family:"Microsoft YaHei"'>4</span></b><b><span style='font-family:
"Microsoft YaHei"'>、插件</span></b></p>

<p class=MsoNormal style='text-indent:21.0pt;line-height:200%'><span
style='font-family:"Microsoft YaHei"'>插件根据“<span lang=EN-US>/etc/sudo.conf</span>”文件的内容动态加载。如果没有“<span
lang=EN-US>/etc/sudo.conf</span>”文件，或者它不包含插件行，<span lang=EN-US>sudo</span>将使用传统<span
lang=EN-US>sudoers</span>安全策略和<span lang=EN-US>I/O</span>日志记录，这相当于以下“<span
lang=EN-US>/etc/sudo.conf</span>”文件</span></p>

<table class=a0 border=1 cellspacing=0 cellpadding=0 width="95%"
 style='width:95.0%;margin-left:24.1pt;border-collapse:collapse;border:none'>
 <tr style='height:14.9pt'>
  <td width=836 valign=top style='width:836.15pt;border:solid windowtext 1.0pt;
  background:#E7E6E6;padding:0cm 5.4pt 0cm 5.4pt;height:14.9pt'>
  <p class=MsoNormal style='line-height:200%'><code><span lang=EN-US
  style='font-size:10.0pt;line-height:200%;font-family:Menlo'>#</span></code></p>
  <p class=MsoNormal style='line-height:200%'><code><span lang=EN-US
  style='font-size:10.0pt;line-height:200%;font-family:Menlo'># Default
  /etc/sudo.conf file</span></code></p>
  <p class=MsoNormal style='line-height:200%'><code><span lang=EN-US
  style='font-size:10.0pt;line-height:200%;font-family:Menlo'>#</span></code></p>
  <p class=MsoNormal style='line-height:200%'><code><span lang=EN-US
  style='font-size:10.0pt;line-height:200%;font-family:Menlo'># Format:</span></code></p>
  <p class=MsoNormal style='line-height:200%'><code><span lang=EN-US
  style='font-size:10.0pt;line-height:200%;font-family:Menlo'>#   Plugin
  plugin_name plugin_path plugin_options ...</span></code></p>
  <p class=MsoNormal align=left style='text-align:left;line-height:200%'><code><span
  lang=EN-US style='font-size:10.0pt;line-height:200%;font-family:Menlo'>#  
  Path askpass /path/to/askpass</span></code></p>
  <p class=MsoNormal align=left style='text-align:left;line-height:200%'><code><span
  lang=EN-US style='font-size:10.0pt;line-height:200%;font-family:Menlo'>#  
  Path noexec /path/to/sudo_noexec.so</span></code></p>
  <p class=MsoNormal align=left style='text-align:left;line-height:200%'><code><span
  lang=EN-US style='font-size:10.0pt;line-height:200%;font-family:Menlo'>#  
  Debug sudo /var/log/sudo_debug all@warn</span></code></p>
  <p class=MsoNormal align=left style='text-align:left;line-height:200%'><code><span
  lang=EN-US style='font-size:10.0pt;line-height:200%;font-family:Menlo'>#  
  Set disable_coredump true</span></code></p>
  <p class=MsoNormal align=left style='text-align:left;line-height:200%'><code><span
  lang=EN-US style='font-size:10.0pt;line-height:200%;font-family:Menlo'>#</span></code></p>
  <p class=MsoNormal align=left style='text-align:left;line-height:200%'><code><span
  lang=EN-US style='font-size:10.0pt;line-height:200%;font-family:Menlo'># The
  plugin_path is relative to /usr/libexec unless</span></code></p>
  <p class=MsoNormal align=left style='text-align:left;line-height:200%'><code><span
  lang=EN-US style='font-size:10.0pt;line-height:200%;font-family:Menlo'>#  
  fully qualified.</span></code></p>
  <p class=MsoNormal align=left style='text-align:left;line-height:200%'><code><span
  lang=EN-US style='font-size:10.0pt;line-height:200%;font-family:Menlo'># The
  plugin_name corresponds to a global symbol in the plugin</span></code></p>
  <p class=MsoNormal align=left style='text-align:left;line-height:200%'><code><span
  lang=EN-US style='font-size:10.0pt;line-height:200%;font-family:Menlo'>#  
  that contains the plugin interface structure.</span></code></p>
  <p class=MsoNormal align=left style='text-align:left;line-height:200%'><code><span
  lang=EN-US style='font-size:10.0pt;line-height:200%;font-family:Menlo'># The plugin_options
  are optional.</span></code></p>
  <p class=MsoNormal align=left style='text-align:left;line-height:200%'><code><span
  lang=EN-US style='font-size:10.0pt;line-height:200%;font-family:Menlo'>#</span></code></p>
  <p class=MsoNormal align=left style='text-align:left;line-height:200%'><code><span
  lang=EN-US style='font-size:10.0pt;line-height:200%;font-family:Menlo'>Plugin
  policy_plugin sudoers.so</span></code></p>
  <p class=MsoNormal align=left style='text-align:left;line-height:200%'><code><span
  lang=EN-US style='font-size:10.0pt;line-height:200%;font-family:Menlo'>Plugin
  io_plugin sudoers.so</span></code></p>
  </td>
 </tr>
</table>

<p class=MsoNormal style='text-indent:21.0pt;line-height:200%'><span
style='font-family:"Microsoft YaHei"'>插件行由插件关键字组成，后面跟着符号名字和包含插件的共享对象的路径。符号名字是插件共享对象中<span
lang=EN-US>struct policy_plugin</span>或<span lang=EN-US>struct io_plugin</span>的名称。路径可以是完全限定的或相对的。如果不完全限定，则相对于“<span
lang=EN-US>/usr/libexec</span>”目录。路径之后的任何附加参数都是作为参数传递给插件的开放函数。不以<span
lang=EN-US>Plugin</span>、<span lang=EN-US>Path</span>、</span></p>

<p class=MsoNormal style='line-height:200%'><span lang=EN-US style='font-family:
"Microsoft YaHei"'>Debug</span><span style='font-family:"Microsoft YaHei"'>、<span
lang=EN-US>Set</span>开头的行将被默认忽略。</span></p>

<p class=MsoNormal style='line-height:200%'><span lang=EN-US style='font-family:
"Microsoft YaHei"'>&nbsp;</span></p>

<p class=MsoNormal style='line-height:200%'><b><span lang=EN-US
style='font-family:"Microsoft YaHei"'>5</span></b><b><span style='font-family:
"Microsoft YaHei"'>、路径</span></b></p>

<p class=MsoNormal style='text-indent:21.0pt;line-height:200%'><span
style='font-family:"Microsoft YaHei"'>路径行由<span lang=EN-US>Path</span>关键字组成，后面跟着要设置的路径的名称及其值。例：</span></p>

<table class=a0 border=1 cellspacing=0 cellpadding=0 width="95%"
 style='width:95.0%;margin-left:24.1pt;border-collapse:collapse;border:none'>
 <tr style='height:14.9pt'>
  <td width=836 valign=top style='width:836.15pt;border:solid windowtext 1.0pt;
  background:#E7E6E6;padding:0cm 5.4pt 0cm 5.4pt;height:14.9pt'>
  <p class=MsoNormal style='line-height:200%'><span lang=EN-US
  style='font-family:"Microsoft YaHei"'>Path noexec /usr/libexec/sudo_noexec.so</span></p>
  <p class=MsoNormal style='line-height:200%'><span lang=EN-US
  style='font-family:"Microsoft YaHei"'>Path askpass /usr/X11R6/bin/ssh-askpass</span></p>
  </td>
 </tr>
</table>

<p class=MsoNormal style='text-indent:21.0pt;line-height:200%'><span
lang=EN-US style='font-family:"Microsoft YaHei"'>&nbsp;</span></p>

<p class=MsoNormal style='text-indent:21.0pt;line-height:200%'><span
style='font-family:"Microsoft YaHei"'>以下与插件无关的路径可以在“<span lang=EN-US>/etc/sudo.conf</span>”文件中设置</span></p>

<p class=MsoNormal style='text-indent:21.0pt;line-height:200%'><span
lang=EN-US style='font-family:"Microsoft YaHei"'>1</span><span
style='font-family:"Microsoft YaHei"'>）<span lang=EN-US>askpass</span>，辅助程序的完全限定路径，用于在没有终端可用时读取用户的密码。当<span
lang=EN-US>sudo</span>从图形应用程序执行时，情况可能是这样。由<span lang=EN-US>askpass</span>指定的程序应该将传递给它的参数显示为提示符，并将用户的密码写入标准输出。<span
lang=EN-US>askpass</span>可能被环境变量<span lang=EN-US>SUDO_ASKPASS</span>覆盖。</span></p>

<p class=MsoNormal style='text-indent:21.0pt;line-height:200%'><span
lang=EN-US style='font-family:"Microsoft YaHei"'>2</span><span
style='font-family:"Microsoft YaHei"'>）<span lang=EN-US>noexec</span>，共享库的完全限定路径，包含仅返回错误的<span
lang=EN-US>execv()</span>、<span lang=EN-US>execve()</span>和<span lang=EN-US>fexecve()</span>库函数的虚拟版本，用于在支持<span
lang=EN-US>LD_PRELOAD</span>或其等效的系统上实现<span lang=EN-US>noexec</span>功能。默认值为“<span
lang=EN-US>/usr/libexec/sudo_noexec.so</span>”。</span></p>

<p class=MsoNormal style='line-height:200%'><span lang=EN-US style='font-family:
"Microsoft YaHei"'>&nbsp;</span></p>

<p class=MsoNormal style='line-height:200%'><b><span lang=EN-US
style='font-family:"Microsoft YaHei"'>6</span></b><b><span style='font-family:
"Microsoft YaHei"'>、调试标志</span></b></p>

<p class=MsoNormal style='text-indent:21.0pt;line-height:200%'><span
lang=EN-US style='font-family:"Microsoft YaHei"'>Sudo</span><span
style='font-family:"Microsoft YaHei"'>版本<span lang=EN-US>1.8.4</span>及更高版本支持一种灵活的调试框架，如果存在问题，可以帮助跟踪<span
lang=EN-US>sudo</span>在内部做什么。</span></p>

<p class=MsoNormal style='text-indent:21.0pt;line-height:200%'><span
lang=EN-US style='font-family:"Microsoft YaHei"'>Debug</span><span
style='font-family:"Microsoft YaHei"'>行由<span lang=EN-US>Debug</span>关键字组成，后面跟着要调试的程序名称<span
lang=EN-US>(sudo</span>、<span lang=EN-US>visudo</span>、<span lang=EN-US>sudoreplay)</span>、调试文件名和以逗号分隔的调试标志列表。<span
lang=EN-US>sudo</span>和<span lang=EN-US>sudoers</span>插件使用的调试标志语法是<span
lang=EN-US>subsystem@priority</span>，但是插件可以自由使用不同的格式，只要它不包括逗号。例如语句“<span
lang=EN-US>Debug sudo /var/log/sudo_debug all@warn,plugin@info</span>”</span> <span
style='font-family:"Microsoft YaHei"'>将会在警告级别和更高级别记录插件子系统的所有调试语句以及信息级别的语句。</span></p>

<p class=MsoNormal style='text-indent:21.0pt;line-height:200%'><span
style='font-family:"Microsoft YaHei"'>目前，每个程序只支持一个调试条目。<span lang=EN-US>sudo</span>调试条目由<span
lang=EN-US>sudo</span>前端、<span lang=EN-US>sudodit</span>和<span lang=EN-US>plugins</span>共享。将来的版本可能会增加对每个插件调试行的支持和<span
lang=EN-US>/</span>或对单个程序的多个调试文件的支持。</span></p>

<p class=MsoNormal style='text-indent:21.0pt;line-height:200%'><span
lang=EN-US style='font-family:"Microsoft YaHei"'>sudo</span><span
style='font-family:"Microsoft YaHei"'>前端使用的优先级依次为：<span lang=EN-US>crit</span>、<span
lang=EN-US>err</span>、<span lang=EN-US>warn</span>、<span lang=EN-US>notice</span>、<span
lang=EN-US>diag</span>、<span lang=EN-US>info</span>、<span lang=EN-US>trace</span>、<span
lang=EN-US>debug.</span>。当指定每个优先级时，还包括所有高于此优先级的优先级。例如，通知的优先级将包括记录在通知中的调试消息以及更高的优先级。</span></p>

<p class=MsoNormal style='text-indent:21.0pt;line-height:200%'><span
lang=EN-US style='font-family:"Microsoft YaHei"'>sudo</span><span
style='font-family:"Microsoft YaHei"'>前端可以使用一下子系统：</span></p>

<table class=MsoTableGrid border=1 cellspacing=0 cellpadding=0 width="95%"
 style='width:95.0%;margin-left:24.1pt;border-collapse:collapse;border:none'>
 <tr>
  <td width="28%" valign=top style='width:28.58%;border:solid windowtext 1.0pt;
  background:#E7E6E6;padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><span style='font-family:"Microsoft YaHei"'>子系统</span></p>
  </td>
  <td width="71%" valign=top style='width:71.42%;border:solid windowtext 1.0pt;
  border-left:none;background:#E7E6E6;padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><span style='font-family:"Microsoft YaHei"'>说明</span></p>
  </td>
 </tr>
 <tr>
  <td width="28%" valign=top style='width:28.58%;border:solid windowtext 1.0pt;
  border-top:none;padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><span lang=EN-US
  style='font-family:"Microsoft YaHei"'>all </span></p>
  </td>
  <td width="71%" valign=top style='width:71.42%;border-top:none;border-left:
  none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
  padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><span style='font-family:"Microsoft YaHei"'>所有的子系统。</span></p>
  </td>
 </tr>
 <tr>
  <td width="28%" valign=top style='width:28.58%;border:solid windowtext 1.0pt;
  border-top:none;padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><span lang=EN-US
  style='font-family:"Microsoft YaHei"'>args</span></p>
  </td>
  <td width="71%" valign=top style='width:71.42%;border-top:none;border-left:
  none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
  padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><span style='font-family:"Microsoft YaHei"'>命令行参数进程。</span></p>
  </td>
 </tr>
 <tr>
  <td width="28%" valign=top style='width:28.58%;border:solid windowtext 1.0pt;
  border-top:none;padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><span lang=EN-US
  style='font-family:"Microsoft YaHei"'>conv</span></p>
  </td>
  <td width="71%" valign=top style='width:71.42%;border-top:none;border-left:
  none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
  padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><span style='font-family:"Microsoft YaHei"'>用户回会话</span></p>
  </td>
 </tr>
 <tr>
  <td width="28%" valign=top style='width:28.58%;border:solid windowtext 1.0pt;
  border-top:none;padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><span lang=EN-US
  style='font-family:"Microsoft YaHei"'>edit</span></p>
  </td>
  <td width="71%" valign=top style='width:71.42%;border-top:none;border-left:
  none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
  padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><span lang=EN-US
  style='font-family:"Microsoft YaHei"'>sudoedit</span><span style='font-family:
  "Microsoft YaHei"'>。</span></p>
  </td>
 </tr>
 <tr>
  <td width="28%" valign=top style='width:28.58%;border:solid windowtext 1.0pt;
  border-top:none;padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><span lang=EN-US
  style='font-family:"Microsoft YaHei"'>exec</span></p>
  </td>
  <td width="71%" valign=top style='width:71.42%;border-top:none;border-left:
  none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
  padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><span style='font-family:"Microsoft YaHei"'>命令执行过程。</span></p>
  </td>
 </tr>
 <tr>
  <td width="28%" valign=top style='width:28.58%;border:solid windowtext 1.0pt;
  border-top:none;padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><span lang=EN-US
  style='font-family:"Microsoft YaHei"'>main</span></p>
  </td>
  <td width="71%" valign=top style='width:71.42%;border-top:none;border-left:
  none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
  padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><span lang=EN-US
  style='font-family:"Microsoft YaHei"'>sudo</span><span style='font-family:
  "Microsoft YaHei"'>的主函数。</span></p>
  </td>
 </tr>
 <tr>
  <td width="28%" valign=top style='width:28.58%;border:solid windowtext 1.0pt;
  border-top:none;padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><span lang=EN-US
  style='font-family:"Microsoft YaHei"'>netif</span></p>
  </td>
  <td width="71%" valign=top style='width:71.42%;border-top:none;border-left:
  none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
  padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><span style='font-family:"Microsoft YaHei"'>网络接口处理。</span></p>
  </td>
 </tr>
 <tr>
  <td width="28%" valign=top style='width:28.58%;border:solid windowtext 1.0pt;
  border-top:none;padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><span lang=EN-US
  style='font-family:"Microsoft YaHei"'>pcomm</span></p>
  </td>
  <td width="71%" valign=top style='width:71.42%;border-top:none;border-left:
  none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
  padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><span style='font-family:"Microsoft YaHei"'>插件会话</span></p>
  </td>
 </tr>
 <tr>
  <td width="28%" valign=top style='width:28.58%;border:solid windowtext 1.0pt;
  border-top:none;padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><span lang=EN-US
  style='font-family:"Microsoft YaHei"'>plugin</span></p>
  </td>
  <td width="71%" valign=top style='width:71.42%;border-top:none;border-left:
  none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
  padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><span style='font-family:"Microsoft YaHei"'>插件配置。</span></p>
  </td>
 </tr>
 <tr>
  <td width="28%" valign=top style='width:28.58%;border:solid windowtext 1.0pt;
  border-top:none;padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><span lang=EN-US
  style='font-family:"Microsoft YaHei"'>pty</span></p>
  </td>
  <td width="71%" valign=top style='width:71.42%;border-top:none;border-left:
  none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
  padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><span style='font-family:"Microsoft YaHei"'>为<span
  lang=EN-US>tty</span>相关代码。</span></p>
  </td>
 </tr>
 <tr>
  <td width="28%" valign=top style='width:28.58%;border:solid windowtext 1.0pt;
  border-top:none;padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><span lang=EN-US
  style='font-family:"Microsoft YaHei"'>selinux</span></p>
  </td>
  <td width="71%" valign=top style='width:71.42%;border-top:none;border-left:
  none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
  padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><span lang=EN-US
  style='font-family:"Microsoft YaHei"'>SELinux</span><span style='font-family:
  "Microsoft YaHei"'>专用处理。</span></p>
  </td>
 </tr>
 <tr>
  <td width="28%" valign=top style='width:28.58%;border:solid windowtext 1.0pt;
  border-top:none;padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><span lang=EN-US
  style='font-family:"Microsoft YaHei"'>util</span></p>
  </td>
  <td width="71%" valign=top style='width:71.42%;border-top:none;border-left:
  none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
  padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><span style='font-family:"Microsoft YaHei"'>实用函数。</span></p>
  </td>
 </tr>
 <tr>
  <td width="28%" valign=top style='width:28.58%;border:solid windowtext 1.0pt;
  border-top:none;padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><span lang=EN-US
  style='font-family:"Microsoft YaHei"'>utmp </span></p>
  </td>
  <td width="71%" valign=top style='width:71.42%;border-top:none;border-left:
  none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
  padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><span lang=EN-US
  style='font-family:"Microsoft YaHei"'>utmp</span><span style='font-family:
  "Microsoft YaHei"'>处理</span></p>
  </td>
 </tr>
</table>

<p class=MsoNormal style='line-height:200%'><span lang=EN-US style='font-family:
"Microsoft YaHei"'>&nbsp;</span></p>

<p class=MsoNormal style='line-height:200%'><b><span lang=EN-US
style='font-family:"Microsoft YaHei"'>7</span></b><b><span style='font-family:
"Microsoft YaHei"'>、退出值</span></b></p>

<p class=MsoNormal style='text-indent:21.0pt;line-height:200%'><span
style='font-family:"Microsoft YaHei"'>当程序成功执行时，<span lang=EN-US>sudo</span>的退出状态将只是被执行的程序的退出状态。否则，如果存在配置<span
lang=EN-US>/</span>权限问题或<span lang=EN-US>sudo</span>无法执行给定的命令，<span lang=EN-US>sudo</span>将以<span
lang=EN-US>1</span>退出。在后一种情况下，错误字符串将打印到标准错误。如果<span lang=EN-US>sudo</span>无法在用户路径中调用<span
lang=EN-US>stat</span>函数统计一个或多个条目，则在<span lang=EN-US>stderr</span>上打印错误。<span
lang=EN-US>(</span>如果该目录不存在，或者它实际上不是一个目录，则忽略该条目，并且不打印错误。<span lang=EN-US>)</span>在正常情况下不应该发生这种情况。<span
lang=EN-US>stat(2)</span>返回<span lang=EN-US>“</span>拒绝权限<span lang=EN-US>”</span>的最常见原因是，如果您正在运行一个自动侦听器，并且您的路径中的一个目录位于当前无法访问的计算机上。</span></p>

<p class=MsoNormal style='line-height:200%'><span lang=EN-US style='font-family:
"Microsoft YaHei"'>&nbsp;</span></p>

<p class=MsoNormal style='line-height:200%'><b><span lang=EN-US
style='font-family:"Microsoft YaHei"'>8</span></b><b><span style='font-family:
"Microsoft YaHei"'>、安全说明</span></b></p>

<p class=MsoNormal style='text-indent:21.0pt;line-height:200%'><span
style='font-family:"Microsoft YaHei"'>当执行外部命令时，<span lang=EN-US>sudo</span>试图保持安全。为了防止命令欺骗，<span
lang=EN-US>sudo</span>在用户路径中搜索命令时，最后检查<span lang=EN-US>“.”</span>和“<span
lang=EN-US>“</span>。但是请注意，实际的<span lang=EN-US>path</span>环境变量没有被修改，而是不改变地传递给<span
lang=EN-US>sudo</span>执行的程序。</span></p>

<p class=MsoNormal style='text-indent:21.0pt;line-height:200%'><span
style='font-family:"Microsoft YaHei"'>请注意，<span lang=EN-US>sudo</span>通常只记录它显式运行的命令。如果用户运行“<span
lang=EN-US>sudo su</span>“或”<span lang=EN-US>sudo sh</span>“之类的命令，则从该<span
lang=EN-US>shell</span>运行的后续命令不受<span lang=EN-US>sudo</span>的安全策略的约束，提供<span
lang=EN-US>shell</span>转义的命令也是如此。如果启用了<span lang=EN-US>I/O</span>日志记录，随后的命令将有它们的输入和输出记录，但这些命令不会有传统的日志。因此，当用户通过<span
lang=EN-US>sudo</span>访问命令时，必须小心，以验证该命令不会无意中给用户一个有效的<span lang=EN-US>root shell</span>。</span></p>

<p class=MsoNormal style='text-indent:21.0pt;line-height:200%'><span
style='font-family:"Microsoft YaHei"'>为了防止泄露潜在的敏感信息，<span lang=EN-US>sudo</span>在执行时默认禁用核心转储。为了帮助调试<span
lang=EN-US>sudo</span>崩溃，您可能希望通过在“<span lang=EN-US>/etc/sudo.conf</span>“文件中将<span
lang=EN-US>“disable_coredump”</span>设置为<span lang=EN-US>false</span>来重新启用核心转储，如下所示</span></p>

<p class=MsoNormal style='text-indent:21.0pt;line-height:200%'><span
lang=EN-US style='font-family:"Microsoft YaHei"'>Set disable_coredump false</span></p>

<p class=MsoNormal style='line-height:200%'><span style='font-family:"Microsoft YaHei"'>请注意，默认情况下，大多数操作系统从<span
lang=EN-US>setuid</span>程序<span lang=EN-US>(</span>包括<span lang=EN-US>sudo)</span>禁用核心转储。要实际获得<span
lang=EN-US>sudo</span>核心文件，您可能需要为<span lang=EN-US>setuid</span>进程启用核心转储。在<span
lang=EN-US>BSD</span>和<span lang=EN-US>Linux</span>系统上，这是通过“<span lang=EN-US>sysctl</span>“命令完成的，在<span
lang=EN-US>Solaris</span>上可以使用”<span lang=EN-US>coreadm</span>“命令。</span></p>

<p class=MsoNormal style='line-height:200%'><span lang=EN-US style='font-family:
"Microsoft YaHei"'>&nbsp;</span></p>

<p class=MsoNormal style='line-height:200%'><b><span lang=EN-US
style='font-family:"Microsoft YaHei"'>9</span></b><b><span style='font-family:
"Microsoft YaHei"'>、环境变量</span></b></p>

<p class=MsoNormal style='text-indent:21.0pt;line-height:200%'><span
lang=EN-US style='font-family:"Microsoft YaHei"'>sudo</span><span
style='font-family:"Microsoft YaHei"'>使用一下环境变量，安全策略控制命令环境的实际内容。</span></p>

<table class=MsoTableGrid border=1 cellspacing=0 cellpadding=0 width="95%"
 style='width:95.0%;margin-left:24.1pt;border-collapse:collapse;border:none'>
 <tr>
  <td width="28%" valign=top style='width:28.58%;border:solid windowtext 1.0pt;
  background:#E7E6E6;padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><span style='font-family:"Microsoft YaHei"'>环境变量</span></p>
  </td>
  <td width="71%" valign=top style='width:71.42%;border:solid windowtext 1.0pt;
  border-left:none;background:#E7E6E6;padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><span style='font-family:"Microsoft YaHei"'>说明</span></p>
  </td>
 </tr>
 <tr>
  <td width="28%" valign=top style='width:28.58%;border:solid windowtext 1.0pt;
  border-top:none;padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><span lang=EN-US
  style='font-family:"Microsoft YaHei"'>EDITOR</span></p>
  </td>
  <td width="71%" valign=top style='width:71.42%;border-top:none;border-left:
  none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
  padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><span style='font-family:"Microsoft YaHei"'>如果没有设置<span
  lang=EN-US>SUDO_EDITOR</span>或<span lang=EN-US>VISUAL</span>，则默认编辑器使用<span
  lang=EN-US>”-e”</span>模式。</span></p>
  </td>
 </tr>
 <tr>
  <td width="28%" valign=top style='width:28.58%;border:solid windowtext 1.0pt;
  border-top:none;padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><span lang=EN-US
  style='font-family:"Microsoft YaHei"'>MAIL</span></p>
  </td>
  <td width="71%" valign=top style='width:71.42%;border-top:none;border-left:
  none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
  padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><span style='font-family:"Microsoft YaHei"'>在“<span
  lang=EN-US>-i</span>“模式中或在<span lang=EN-US>sudoers</span>中启用<span lang=EN-US>env_reset</span>时，将其设置为目标用户的邮件线轴。</span></p>
  </td>
 </tr>
 <tr>
  <td width="28%" valign=top style='width:28.58%;border:solid windowtext 1.0pt;
  border-top:none;padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><span lang=EN-US
  style='font-family:"Microsoft YaHei"'>HOME</span></p>
  </td>
  <td width="71%" valign=top style='width:71.42%;border-top:none;border-left:
  none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
  padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><span style='font-family:"Microsoft YaHei"'>如果指定了“<span
  lang=EN-US>-i</span>“或”<span lang=EN-US>-H</span>“，在<span lang=EN-US>sudoers</span>中赋值给目标用户的<span
  lang=EN-US>home</span>目录，或者赋值给<span lang=EN-US>env_reset</span>或<span
  lang=EN-US>all_set_home</span>。或者当指定”<span lang=EN-US>-s</span>“选项时，<span
  lang=EN-US>sudoers</span>中赋值给<span lang=EN-US>set_home</span>。</span></p>
  </td>
 </tr>
 <tr>
  <td width="28%" valign=top style='width:28.58%;border:solid windowtext 1.0pt;
  border-top:none;padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><span lang=EN-US
  style='font-family:"Microsoft YaHei"'>PATH</span></p>
  </td>
  <td width="71%" valign=top style='width:71.42%;border-top:none;border-left:
  none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
  padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><span style='font-family:"Microsoft YaHei"'>可能被安全策略覆盖</span></p>
  </td>
 </tr>
 <tr>
  <td width="28%" valign=top style='width:28.58%;border:solid windowtext 1.0pt;
  border-top:none;padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><span lang=EN-US
  style='font-family:"Microsoft YaHei"'>SEHLL</span></p>
  </td>
  <td width="71%" valign=top style='width:71.42%;border-top:none;border-left:
  none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
  padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><span style='font-family:"Microsoft YaHei"'>使用“<span
  lang=EN-US>-s</span>“选项，执行运行的<span lang=EN-US>shell</span></span></p>
  </td>
 </tr>
 <tr>
  <td width="28%" valign=top style='width:28.58%;border:solid windowtext 1.0pt;
  border-top:none;padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><span lang=EN-US
  style='font-family:"Microsoft YaHei"'>SUDO_ASKPASS</span></p>
  </td>
  <td width="71%" valign=top style='width:71.42%;border-top:none;border-left:
  none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
  padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><span style='font-family:"Microsoft YaHei"'>如果没有可用的终端，或者指定了“<span
  lang=EN-US>-A“</span>选项，则指定用于读取密码的辅助程序的路径。</span></p>
  </td>
 </tr>
 <tr>
  <td width="28%" valign=top style='width:28.58%;border:solid windowtext 1.0pt;
  border-top:none;padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><span lang=EN-US
  style='font-family:"Microsoft YaHei"'>SUDO_COMMAND</span></p>
  </td>
  <td width="71%" valign=top style='width:71.42%;border-top:none;border-left:
  none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
  padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><span style='font-family:"Microsoft YaHei"'>赋值给<span
  lang=EN-US>sudo</span>运行的命令</span></p>
  </td>
 </tr>
 <tr>
  <td width="28%" valign=top style='width:28.58%;border:solid windowtext 1.0pt;
  border-top:none;padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><span lang=EN-US
  style='font-family:"Microsoft YaHei"'>SUDO_EDITOR</span></p>
  </td>
  <td width="71%" valign=top style='width:71.42%;border-top:none;border-left:
  none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
  padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><span style='font-family:"Microsoft YaHei"'>“<span
  lang=EN-US>-e</span>“模式下的默认编辑器</span></p>
  </td>
 </tr>
 <tr>
  <td width="28%" valign=top style='width:28.58%;border:solid windowtext 1.0pt;
  border-top:none;padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><span lang=EN-US
  style='font-family:"Microsoft YaHei"'>SUDO_GID</span></p>
  </td>
  <td width="71%" valign=top style='width:71.42%;border-top:none;border-left:
  none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
  padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><span style='font-family:"Microsoft YaHei"'>赋值给调用<span
  lang=EN-US>sudo</span>的用户的组<span lang=EN-US>ID</span></span></p>
  </td>
 </tr>
 <tr>
  <td width="28%" valign=top style='width:28.58%;border:solid windowtext 1.0pt;
  border-top:none;padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><span lang=EN-US
  style='font-family:"Microsoft YaHei"'>SUDO_PROMPT</span></p>
  </td>
  <td width="71%" valign=top style='width:71.42%;border-top:none;border-left:
  none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
  padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><span style='font-family:"Microsoft YaHei"'>作为默认的密码提示语句</span></p>
  </td>
 </tr>
 <tr>
  <td width="28%" valign=top style='width:28.58%;border:solid windowtext 1.0pt;
  border-top:none;padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><span lang=EN-US
  style='font-family:"Microsoft YaHei"'>SUDO_PS1</span></p>
  </td>
  <td width="71%" valign=top style='width:71.42%;border-top:none;border-left:
  none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
  padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><span style='font-family:"Microsoft YaHei"'>如果设置，<span
  lang=EN-US>PS1</span>将被设置为正在运行的程序的值。</span></p>
  </td>
 </tr>
 <tr>
  <td width="28%" valign=top style='width:28.58%;border:solid windowtext 1.0pt;
  border-top:none;padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><span lang=EN-US
  style='font-family:"Microsoft YaHei"'>SUDO_UID</span></p>
  </td>
  <td width="71%" valign=top style='width:71.42%;border-top:none;border-left:
  none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
  padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><span style='font-family:"Microsoft YaHei"'>赋值给调用<span
  lang=EN-US>sudo</span>的用户的<span lang=EN-US>ID</span></span></p>
  </td>
 </tr>
 <tr>
  <td width="28%" valign=top style='width:28.58%;border:solid windowtext 1.0pt;
  border-top:none;padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><span lang=EN-US
  style='font-family:"Microsoft YaHei"'>SUDO_USER</span></p>
  </td>
  <td width="71%" valign=top style='width:71.42%;border-top:none;border-left:
  none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
  padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><span style='font-family:"Microsoft YaHei"'>赋值给调用<span
  lang=EN-US>sudo</span>的用户登录名</span></p>
  </td>
 </tr>
 <tr>
  <td width="28%" valign=top style='width:28.58%;border:solid windowtext 1.0pt;
  border-top:none;padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><span lang=EN-US
  style='font-family:"Microsoft YaHei"'>USER</span></p>
  </td>
  <td width="71%" valign=top style='width:71.42%;border-top:none;border-left:
  none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
  padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><span style='font-family:"Microsoft YaHei"'>赋值给目标用户（默认是<span
  lang=EN-US>root</span>，除非指定“<span lang=EN-US>-u</span>“选项）</span></p>
  </td>
 </tr>
 <tr>
  <td width="28%" valign=top style='width:28.58%;border:solid windowtext 1.0pt;
  border-top:none;padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><span lang=EN-US
  style='font-family:"Microsoft YaHei"'>VISUAL</span></p>
  </td>
  <td width="71%" valign=top style='width:71.42%;border-top:none;border-left:
  none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
  padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><span style='font-family:"Microsoft YaHei"'>如果在“<span
  lang=EN-US>-e</span>“模式下没有指定”<span lang=EN-US>SUDO_EDITOR</span>“，那么这个就是默认编辑器</span></p>
  </td>
 </tr>
</table>

<p class=MsoNormal style='line-height:200%'><span lang=EN-US style='font-family:
"Microsoft YaHei"'>&nbsp;</span></p>

<p class=MsoNormal style='line-height:200%'><b><span lang=EN-US
style='font-family:"Microsoft YaHei"'>10</span></b><b><span style='font-family:
"Microsoft YaHei"'>、实例</span></b></p>

<p class=MsoNormal style='text-indent:21.0pt;line-height:200%'><span
lang=EN-US style='font-family:"Microsoft YaHei"'>1</span><span
style='font-family:"Microsoft YaHei"'>）查看当前用户支持的指令</span></p>

<table class=a0 border=1 cellspacing=0 cellpadding=0 width="95%"
 style='width:95.0%;margin-left:24.1pt;border-collapse:collapse;border:none'>
 <tr style='height:14.9pt'>
  <td width=836 valign=top style='width:836.15pt;border:solid windowtext 1.0pt;
  background:#E7E6E6;padding:0cm 5.4pt 0cm 5.4pt;height:14.9pt'>
  <p class=MsoNormal style='line-height:200%'><code><b><span lang=EN-US
  style='font-size:10.0pt;line-height:200%;font-family:Menlo'>[weijie@192 /]$
  sudo –l       //</span></b></code><code><b><span style='font-size:10.0pt;
  line-height:200%;font-family:DengXian'>当前用户没有权利执行任何</span></b></code><code><b><span
  lang=EN-US style='font-size:10.0pt;line-height:200%;font-family:Menlo'>sudo</span></b></code><code><b><span
  style='font-size:10.0pt;line-height:200%;font-family:DengXian'>指令</span></b></code></p>
  <p class=MsoNormal style='line-height:200%'><code><b><span lang=EN-US
  style='font-size:10.0pt;line-height:200%;font-family:Menlo'>[sudo] password
  for weijie: </span></b></code></p>
  <p class=MsoNormal style='line-height:200%'><code><b><span style='font-size:
  10.0pt;line-height:200%;font-family:DengXian'>对不起，用户</span></b></code><code><b><span
  lang=EN-US style='font-size:10.0pt;line-height:200%;font-family:Menlo'>
  weijie </span></b></code><code><b><span style='font-size:10.0pt;line-height:
  200%;font-family:DengXian'>不能在</span></b></code><code><b><span lang=EN-US
  style='font-size:10.0pt;line-height:200%;font-family:Menlo'> 192 </span></b></code><code><b><span
  style='font-size:10.0pt;line-height:200%;font-family:DengXian'>上运行</span></b></code><code><b><span
  lang=EN-US style='font-size:10.0pt;line-height:200%;font-family:Menlo'> sudo</span></b></code><code><b><span
  style='font-size:10.0pt;line-height:200%;font-family:DengXian'>。</span></b></code></p>
  <p class=MsoNormal style='line-height:200%'><code><span lang=EN-US
  style='font-size:10.0pt;line-height:200%;font-family:Menlo'>You have new mail
  in /var/spool/mail/root</span></code></p>
  <p class=MsoNormal style='line-height:200%'><code><span lang=EN-US
  style='font-size:10.0pt;line-height:200%;font-family:Menlo'>&nbsp;</span></code></p>
  <p class=MsoNormal style='line-height:200%'><code><b><span lang=EN-US
  style='font-size:10.0pt;line-height:200%;font-family:Menlo'>[root@192 /]#
  sudo –l       //</span></b></code><code><b><span style='font-size:10.0pt;
  line-height:200%;font-family:DengXian'>当前用户是</span></b></code><code><b><span
  lang=EN-US style='font-size:10.0pt;line-height:200%;font-family:Menlo'>root</span></b></code><code><b><span
  style='font-size:10.0pt;line-height:200%;font-family:DengXian'>，因此可以执行所有的</span></b></code><code><b><span
  lang=EN-US style='font-size:10.0pt;line-height:200%;font-family:Menlo'>sudo</span></b></code><code><b><span
  style='font-size:10.0pt;line-height:200%;font-family:DengXian'>指令</span></b></code></p>
  <p class=MsoNormal style='line-height:200%'><code><span style='font-size:
  10.0pt;line-height:200%;font-family:DengXian'>匹配此主机上</span></code><code><span
  lang=EN-US style='font-size:10.0pt;line-height:200%;font-family:Menlo'> root </span></code><code><span
  style='font-size:10.0pt;line-height:200%;font-family:DengXian'>的默认条目：</span></code></p>
  <p class=MsoNormal style='line-height:200%'><code><span lang=EN-US
  style='font-size:10.0pt;line-height:200%;font-family:Menlo'>    requiretty,
  !visiblepw, always_set_home, env_reset, env_keep=&quot;COLORS</span></code></p>
  <p class=MsoNormal style='line-height:200%'><code><span lang=EN-US
  style='font-size:10.0pt;line-height:200%;font-family:Menlo'>    DISPLAY
  HOSTNAME HISTSIZE INPUTRC KDEDIR LS_COLORS&quot;, env_keep+=&quot;MAIL PS1</span></code></p>
  <p class=MsoNormal style='line-height:200%'><code><span lang=EN-US
  style='font-size:10.0pt;line-height:200%;font-family:Menlo'>    PS2 QTDIR
  USERNAME LANG LC_ADDRESS LC_CTYPE&quot;, env_keep+=&quot;LC_COLLATE</span></code></p>
  <p class=MsoNormal style='line-height:200%'><code><span lang=EN-US
  style='font-size:10.0pt;line-height:200%;font-family:Menlo'>   
  LC_IDENTIFICATION LC_MEASUREMENT LC_MESSAGES&quot;,
  env_keep+=&quot;LC_MONETARY</span></code></p>
  <p class=MsoNormal style='line-height:200%'><code><span lang=EN-US
  style='font-size:10.0pt;line-height:200%;font-family:Menlo'>    LC_NAME
  LC_NUMERIC LC_PAPER LC_TELEPHONE&quot;, env_keep+=&quot;LC_TIME LC_ALL</span></code></p>
  <p class=MsoNormal style='line-height:200%'><code><span lang=EN-US
  style='font-size:10.0pt;line-height:200%;font-family:Menlo'>    LANGUAGE
  LINGUAS _XKB_CHARSET XAUTHORITY&quot;,</span></code></p>
  <p class=MsoNormal style='line-height:200%'><code><span lang=EN-US
  style='font-size:10.0pt;line-height:200%;font-family:Menlo'>   
  secure_path=/sbin\:/bin\:/usr/sbin\:/usr/bin</span></code></p>
  <p class=MsoNormal style='line-height:200%'><code><span lang=EN-US
  style='font-size:10.0pt;line-height:200%;font-family:Menlo'>&nbsp;</span></code></p>
  <p class=MsoNormal style='line-height:200%'><code><b><span style='font-size:
  10.0pt;line-height:200%;font-family:DengXian'>用户</span></b></code><code><b><span
  lang=EN-US style='font-size:10.0pt;line-height:200%;font-family:Menlo'> root </span></b></code><code><b><span
  style='font-size:10.0pt;line-height:200%;font-family:DengXian'>可以在该主机上运行以下命令：</span></b></code></p>
  <p class=MsoNormal style='line-height:200%'><code><b><span lang=EN-US
  style='font-size:10.0pt;line-height:200%;font-family:Menlo'>    (ALL) ALL</span></b></code></p>
  </td>
 </tr>
</table>

<p class=MsoNormal style='text-indent:21.0pt;line-height:200%'><span
lang=EN-US style='font-family:"Microsoft YaHei"'>2</span><span
style='font-family:"Microsoft YaHei"'>）以指定的用户身份来执行命令，<b>不可以指定<span lang=EN-US>root</span></b></span></p>

<table class=a0 border=1 cellspacing=0 cellpadding=0 width="95%"
 style='width:95.0%;margin-left:24.1pt;border-collapse:collapse;border:none'>
 <tr style='height:14.9pt'>
  <td width=836 valign=top style='width:836.15pt;border:solid windowtext 1.0pt;
  background:#E7E6E6;padding:0cm 5.4pt 0cm 5.4pt;height:14.9pt'>
  <p class=MsoNormal style='line-height:200%'><code><span lang=EN-US
  style='font-size:10.0pt;line-height:200%;font-family:Menlo'>[root@192 /]# <b>sudo
  -u weijie ls /home/david/         //</b></span></code><code><b><span
  style='font-size:10.0pt;line-height:200%;font-family:DengXian'>以用户</span></b></code><code><b><span
  lang=EN-US style='font-size:10.0pt;line-height:200%;font-family:Menlo'>weijie</span></b></code><code><b><span
  style='font-size:10.0pt;line-height:200%;font-family:DengXian'>的身份来查看用户</span></b></code><code><b><span
  lang=EN-US style='font-size:10.0pt;line-height:200%;font-family:Menlo'>david</span></b></code><code><b><span
  style='font-size:10.0pt;line-height:200%;font-family:DengXian'>的家目录，很明显是没有权利的</span></b></code></p>
  <p class=MsoNormal style='line-height:200%'><code><b><span lang=EN-US
  style='font-size:10.0pt;line-height:200%;font-family:Menlo'>ls: </span></b></code><code><b><span
  style='font-size:10.0pt;line-height:200%;font-family:DengXian'>无法打开目录</span></b></code><code><b><span
  lang=EN-US style='font-size:10.0pt;line-height:200%;font-family:Menlo'>/home/david/:
  </span></b></code><code><b><span style='font-size:10.0pt;line-height:200%;
  font-family:DengXian'>权限不够</span></b></code></p>
  <p class=MsoNormal style='line-height:200%'><code><span lang=EN-US
  style='font-size:10.0pt;line-height:200%;font-family:Menlo'>[root@192 /]# <b>sudo
  -u weijie ls /home/weijie/       //</b></span></code><code><b><span
  style='font-size:10.0pt;line-height:200%;font-family:DengXian'>以用户</span></b></code><code><b><span
  lang=EN-US style='font-size:10.0pt;line-height:200%;font-family:Menlo'>weijie</span></b></code><code><b><span
  style='font-size:10.0pt;line-height:200%;font-family:DengXian'>的身份来查看用户</span></b></code><code><b><span
  lang=EN-US style='font-size:10.0pt;line-height:200%;font-family:Menlo'>weijie</span></b></code><code><b><span
  style='font-size:10.0pt;line-height:200%;font-family:DengXian'>的家目录，这个当然可以</span></b></code></p>
  <p class=MsoNormal style='line-height:200%'><code><b><span lang=EN-US
  style='font-size:10.0pt;line-height:200%;font-family:Menlo'>1.zip  mail</span></b></code></p>
  <p class=MsoNormal style='line-height:200%'><code><span lang=EN-US
  style='font-size:10.0pt;line-height:200%;font-family:Menlo'>[root@192 /]# <b>sudo 
  ls /home/david/                    //</b></span></code><code><b><span
  style='font-size:10.0pt;line-height:200%;font-family:DengXian'>直接查看用户</span></b></code><code><b><span
  lang=EN-US style='font-size:10.0pt;line-height:200%;font-family:Menlo'>david</span></b></code><code><b><span
  style='font-size:10.0pt;line-height:200%;font-family:DengXian'>家目录，由于当前在</span></b></code><code><b><span
  lang=EN-US style='font-size:10.0pt;line-height:200%;font-family:Menlo'>root</span></b></code><code><b><span
  style='font-size:10.0pt;line-height:200%;font-family:DengXian'>环境下，因此完全可以</span></b></code></p>
  <p class=MsoNormal style='line-height:200%'><code><b><span lang=EN-US
  style='font-size:10.0pt;line-height:200%;font-family:Menlo'>mail</span></b></code></p>
  </td>
 </tr>
</table>

<p class=MsoNormal style='text-indent:21.0pt;line-height:200%'><span
lang=EN-US style='font-family:"Microsoft YaHei"'>3</span><span
style='font-family:"Microsoft YaHei"'>）其他例子代码</span></p>

<table class=a0 border=1 cellspacing=0 cellpadding=0 width="95%"
 style='width:95.0%;margin-left:24.1pt;border-collapse:collapse;border:none'>
 <tr style='height:14.9pt'>
  <td width=836 valign=top style='width:836.15pt;border:solid windowtext 1.0pt;
  background:#E7E6E6;padding:0cm 5.4pt 0cm 5.4pt;height:14.9pt'>
  <p class=MsoNormal style='line-height:200%'><code><b><span lang=EN-US
  style='font-size:10.0pt;line-height:200%;font-family:Menlo'>$ sudo -u yaz ls
  ~yaz                               //</span></b></code><code><b><span
  style='font-size:10.0pt;line-height:200%;font-family:DengXian'>查看用户</span></b></code><code><b><span
  lang=EN-US style='font-size:10.0pt;line-height:200%;font-family:Menlo'>yaz</span></b></code><code><b><span
  style='font-size:10.0pt;line-height:200%;font-family:DengXian'>的家目录</span></b></code></p>
  <p class=MsoNormal style='line-height:200%'><code><b><span lang=EN-US
  style='font-size:10.0pt;line-height:200%;font-family:Menlo'>$ sudo -u www vi
  ~www/htdocs/index.html          //</span></b></code><code><b><span
  style='font-size:10.0pt;line-height:200%;font-family:DengXian'>以用户</span></b></code><code><b><span
  lang=EN-US style='font-size:10.0pt;line-height:200%;font-family:Menlo'>www</span></b></code><code><b><span
  style='font-size:10.0pt;line-height:200%;font-family:DengXian'>的身份编辑文件</span></b></code></p>
  <p class=MsoNormal style='line-height:200%'><code><b><span lang=EN-US
  style='font-size:10.0pt;line-height:200%;font-family:Menlo'>$ sudo -g adm
  view /var/log/syslog                //</span></b></code><code><b><span
  style='font-size:10.0pt;line-height:200%;font-family:DengXian'>以组</span></b></code><code><b><span
  lang=EN-US style='font-size:10.0pt;line-height:200%;font-family:Menlo'>adm</span></b></code><code><b><span
  style='font-size:10.0pt;line-height:200%;font-family:DengXian'>的身份去查看日志文件，</span></b></code><code><b><span
  lang=EN-US style='font-size:10.0pt;line-height:200%;font-family:Menlo'>  </span></b></code></p>
  <p class=MsoNormal style='line-height:200%'><code><b><span lang=EN-US
  style='font-size:10.0pt;line-height:200%;font-family:Menlo'>$ sudo -u jim -g
  audio vi ~jim/sound.txt         //</span></b></code><code><b><span
  style='font-size:10.0pt;line-height:200%;font-family:DengXian'>要使用不同的主组以</span></b></code><code><b><span
  lang=EN-US style='font-size:10.0pt;line-height:200%;font-family:Menlo'>Jim</span></b></code><code><b><span
  style='font-size:10.0pt;line-height:200%;font-family:DengXian'>的身份运行编辑器</span></b></code></p>
  <p class=MsoNormal style='line-height:200%'><code><b><span lang=EN-US
  style='font-size:10.0pt;line-height:200%;font-family:Menlo'>$ sudo shutdown
  -r +15 &quot;quick reboot&quot;             //</span></b></code><code><b><span
  style='font-size:10.0pt;line-height:200%;font-family:DengXian'>关机</span></b></code></p>
  <p class=MsoNormal style='line-height:200%'><code><b><span lang=EN-US
  style='font-size:10.0pt;line-height:200%;font-family:Menlo'>$ sudo sh -c
  &quot;cd /home ; du -s * | sort -rn &gt; USAGE&quot;   //</span></b></code><code><b><span
  style='font-size:10.0pt;line-height:200%;font-family:DengXian'>若要对</span></b></code><code><b><span
  lang=EN-US style='font-size:10.0pt;line-height:200%;font-family:Menlo'>/home</span></b></code><code><b><span
  style='font-size:10.0pt;line-height:200%;font-family:DengXian'>分区中的目录进行使用列表，请注意，这将在子</span></b></code><code><b><span
  lang=EN-US style='font-size:10.0pt;line-height:200%;font-family:Menlo'>shell</span></b></code><code><b><span
  style='font-size:10.0pt;line-height:200%;font-family:DengXian'>中运行命令，以使</span></b></code><code><b><span
  lang=EN-US style='font-size:10.0pt;line-height:200%;font-family:Menlo'>cd</span></b></code><code><b><span
  style='font-size:10.0pt;line-height:200%;font-family:DengXian'>和文件重定向工作</span></b></code><code><span
  style='font-size:10.0pt;line-height:200%;font-family:DengXian'>。</span></code></p>
  </td>
 </tr>
</table>

<p class=MsoNormal style='line-height:200%'><span lang=EN-US style='font-family:
"Microsoft YaHei"'>&nbsp;</span></p>

<p class=MsoNormal style='line-height:200%'><span lang=EN-US style='font-family:
"Microsoft YaHei"'>&nbsp;</span></p>

<p class=MsoNormal style='line-height:200%'><span lang=EN-US style='font-family:
"Microsoft YaHei"'>&nbsp;</span></p>

<p class=MsoNormal align=center style='text-align:center;line-height:200%'><span
lang=EN-US style='font-family:"Microsoft YaHei"'>Copyright@david 
zhytwj2018@163.com</span></p>

</div>

</body>

</html>
